package cn.sh.yhk.mapper.basic;

import cn.sh.yhk.model.basic.SCommonConfig;
import cn.sh.yhk.model.basic.SCommonConfigExample;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
public interface SCommonConfigMapper {
    @SelectProvider(type = SCommonConfigSqlProvider.class, method = "countByExample")
    long countByExample(SCommonConfigExample example);

    @DeleteProvider(type = SCommonConfigSqlProvider.class, method = "deleteByExample")
    int deleteByExample(SCommonConfigExample example);

    @Insert({
            "insert into s_common_config (id, parameter, ",
            "value, comment, ",
            "is_show)",
            "values (#{id,jdbcType=INTEGER}, #{parameter,jdbcType=VARCHAR}, ",
            "#{value,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, ",
            "#{isShow,jdbcType=INTEGER})"
    })
    int insert(SCommonConfig record);

    @InsertProvider(type = SCommonConfigSqlProvider.class, method = "insertSelective")
    int insertSelective(SCommonConfig record);

    @SelectProvider(type = SCommonConfigSqlProvider.class, method = "selectByExample")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER),
            @Result(column = "parameter", property = "parameter", jdbcType = JdbcType.VARCHAR),
            @Result(column = "value", property = "value", jdbcType = JdbcType.VARCHAR),
            @Result(column = "comment", property = "comment", jdbcType = JdbcType.VARCHAR),
            @Result(column = "is_show", property = "isShow", jdbcType = JdbcType.INTEGER)
    })
    List<SCommonConfig> selectByExample(SCommonConfigExample example);

    @SelectProvider(type = SCommonConfigSqlProvider.class, method = "selectByExample")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER),
            @Result(column = "parameter", property = "parameter", jdbcType = JdbcType.VARCHAR),
            @Result(column = "value", property = "value", jdbcType = JdbcType.VARCHAR),
            @Result(column = "comment", property = "comment", jdbcType = JdbcType.VARCHAR),
            @Result(column = "is_show", property = "isShow", jdbcType = JdbcType.INTEGER)
    })
    SCommonConfig selectConfigByExample(SCommonConfigExample example);

    @UpdateProvider(type = SCommonConfigSqlProvider.class, method = "updateByExampleSelective")
    int updateByExampleSelective(@Param("record") SCommonConfig record, @Param("example") SCommonConfigExample example);

    @UpdateProvider(type = SCommonConfigSqlProvider.class, method = "updateByExample")
    int updateByExample(@Param("record") SCommonConfig record, @Param("example") SCommonConfigExample example);
}